package fr.efrei.paumier.common.time;

import java.time.Duration;
import java.util.List;

import fr.efrei.abrousserajaspera.cloudPandemic.Habitant;
import fr.efrei.abrousserajaspera.cloudPandemic.Ville;
import fr.efrei.paumier.common.time.Event;
import fr.efrei.paumier.common.time.GameEngine;

public class Soin implements Event{
	private Ville ville;
	private List<Event> triggeredEventsList;
	private Duration duration;
	private float rate;// rythm: 1s ou 3min ou...
	private Habitant habInfecte;

	public Soin(float rate,
			GameEngine manager, List<Event> triggeredEventsList, Ville ville, Habitant h) {
		this.duration = Duration.ofSeconds(10);	
		this.rate = rate;
		this.ville = ville;
		this.habInfecte = h;
	}

	@Override
	public void trigger() {
		triggeredEventsList.add(this);
		ville.guerir(habInfecte);
	}

	@Override
	public Duration getBaseDuration() {
		return duration;
	}

	public void setRate(float rate) {		
		this.rate = rate;
	}

	@Override
	public double getRate() {
		return this.rate;
	}

}
